CREATE PROCEDURE coreDTSave
(
	@PK_ID int output,
	@FK_ParentID int,
	@Name nvarchar(100)
)
AS
BEGIN
	IF @PK_ID = -1
	BEGIN
		SET NOCOUNT ON;

		INSERT INTO DataTaxonomy (FK_ParentID, [Name]) VALUES (@FK_ParentID, @Name);

		SET NOCOUNT OFF;
		SELECT @PK_ID = @@IDENTITY;
	END
	ELSE
	BEGIN

		UPDATE DataTaxonomy SET [Name] = @Name WHERE PK_ID=@PK_ID;

	END
END